/**
 * Copyright (C), 2024, Y2 T205
 * FileName: ch02_04
 * Author: Lenovo
 * Date: 2024-01-17 12:38
 * Description:
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */


package com.example.multithreading;


/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Lenovo
 * @create 2024-01-17
 * @since 1.0.0
 */

public class ch02_04 {

    //javac -Xmx512m -Xms64m ch02_04.java 1
    public static void main(String[] args) {
        /*if(args.length<1){
            System.out.println("please enter the stack size.");
            System.exit(1);
        }*/
        ThreadGroup  group =new ThreadGroup("TestGroup");

        Runnable runnable =new Runnable() {
            final int MAX =Integer.MAX_VALUE;
            @Override
            public void run() {
              int i =0;
              recurse(i);
            }

            private void recurse(int i){
                System.out.println(i);
                if(i<MAX){
                       recurse(i+1);
                }
            }
        };

        Thread thread =new Thread(group,runnable,"Test",1);
        thread.start();
    }


}
